//
//  ParkFeeOrderDetailController.m
//  KuWeiPark
//
//  Created by Kevin Su on 15/5/5.
//  Copyright (c) 2015年 Clief. All rights reserved.
//

#import "ParkFeeOrderDetailController.h"
#import "ParkFeeOrderDetailCell.h"
#import "ParkFeeOrderDetailHeaderCell.h"
#import "ParkFeeOrderDetailFooterCell.h"

@interface ParkFeeOrderDetailController ()

@end

@implementation ParkFeeOrderDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.tableFooterView = [[UITableView alloc] initWithFrame:CGRectZero];
}

#pragma mark - UITableView Delegate && DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 2 + 2;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NSInteger row = indexPath.row;
    if(row == 0){
        
        return 70;
    }else if(row == 3){
        
        return 266;
    }
    return 110;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NSString *orderCellIdentifier = @"ParkFeeOrderDetailCell";
    
    NSInteger row = indexPath.row;
    
    if(row == 0){
        
        ParkFeeOrderDetailHeaderCell *headerCell = [[[NSBundle mainBundle] loadNibNamed:@"ParkFeeOrderDetailHeaderCell" owner:self options:nil] lastObject];
        return headerCell;
    }else if(row == 3){
        
        ParkFeeOrderDetailFooterCell *footerCell = [[[NSBundle mainBundle] loadNibNamed:@"ParkFeeOrderDetailFooterCell" owner:self options:nil] lastObject];
        return footerCell;
    }else{
        
        ParkFeeOrderDetailCell *cell = [self.tableView dequeueReusableCellWithIdentifier:orderCellIdentifier];
        return cell;
    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - IBActions

- (IBAction)back:(id)sender {
    
    [self.navigationController popViewControllerAnimated:YES];
}


@end
